﻿@using System.Data;
@using FileServer.Common;

@{
    Layout = "~/Views/Shared/PageTemplate.cshtml";
}

<title>后台日志</title>
<script>
    $(document).ready(function () {
        document.getElementById("hid_city").value = "@ViewBag.SearchCity";
        document.getElementById("hid_project").value = "@ViewBag.SearchProject";
        document.getElementById("hid_dep").value = "@ViewBag.Search_Department";

    @*document.getElementById("txt_Search_comName").value = '@(ViewBag.Search_comName)';
            document.getElementById("txt_Search_projectName").value = '@(ViewBag.Search_projectName)';
            document.getElementById("txt_Search_depName").value = '@(ViewBag.Search_depName)';*@

            document.getElementById("txt_Search_Content").value = '@(ViewBag.Search_Content)';
        document.getElementById("txt_Search_Name").value = '@(ViewBag.Search_Name)';
        document.getElementById("StartDate").value = '@(ViewBag.Search_StartDate)';
        document.getElementById("EndDate").value = '@(ViewBag.Search_EndDate)';




        function OutExcel() {
            window.open("SystemLogExcel?sel_City=" + document.getElementById("sel_City").value + "&sel_Project=" + document.getElementById("sel_Project").value + "&sel_Dep=" + document.getElementById("sel_Dep").value + "&txt_Search_Name=" + document.getElementById("txt_Search_Name").value + "&txt_Search_Mobile=" + document.getElementById("txt_Search_Mobile").value + "&sel_SearchRole=" + document.getElementById("sel_SearchRole").value + "&txt_Search_Content=" + document.getElementById("txt_Search_Content").value + "&StartDate=" + document.getElementById("StartDate").value + "&EndDate=" + document.getElementById("EndDate").value + "");
        }
</script>

<div id="saper-container">
    <form id="searchForm" name="searchForm" action="list" method="post">

        <input type="hidden" id="hid_city" name="hid_city" value="" />
        <input type="hidden" id="hid_project" name="hid_project" value="" />
        <input type="hidden" id="hid_dep" name="hid_dep" value="" />

        <div id="saper-hd"></div>
        <div id="saper-bd">
            <div class="subfiled clearfix">
                <h2>后台日志</h2>
            </div>
            <div class="subfiled-content">
                <div class="search-box clearfix">


                    <div class="kv-item clearfix">
                        <label>姓名：</label>
                        <div class="kv-item-content">
                            <input type="text" id="txt_Search_Name" value="@ViewBag.Search_Name" name="txt_Search_Name" placeholder="姓名" style="width:80px;" />
                        </div>
                    </div>

                    <div class="kv-item clearfix">
                        <label>操作内容：</label>
                        <div class="kv-item-content">
                            <input type="text" id="txt_Search_Content" value="@ViewBag.Search_Comtent" name="txt_Search_Content" placeholder="操作内容" />
                        </div>
                    </div>
                    <div class="kv-item clearfix">
                        <label>时间：</label>
                        <div class="kv-item-content">
                            <input id="StartDate" name="StartDate" onclick="WdatePicker()" placeholder="开始时间" style="width: 80px" type="text" autocomplete="off" />
                            至
                            <input id="EndDate" name="EndDate" onclick="WdatePicker()" placeholder="结束时间" style="width: 80px" type="text" autocomplete="off" />&nbsp;
                        </div>
                    </div>
                    <a href="javascript:;" id="but_Search" name="but_Search" class="sapar-btn sapar-btn-recom query-btn">查询</a>
                </div>


                <!--表格开始-->
                <div class="table">

                    <!--表格具体内容-->
                    <div class="table-box">
                        <table>
                            <thead>
                                <tr>
                                    <th style="width:50px;">序号</th>
                                    <th style="width:150px;">操作人</th>
                                    <th>操作时间-操作内容</th>
                                    <th style="width:150px;">IP</th>
                                </tr>
                            </thead>
                            <tbody>

                                @{
                                    int rowcount = 0; string result = "";
                                }
                                @foreach (DataRow item in (ViewData["DataList"] as DataTable).Rows)
                                {
                                    rowcount = rowcount + 1;
                                    <tr @Html.Raw(rowcount % 2 == 0 ? "style='background-color:#EFF6FA';" : "") id="tr_@rowcount" onclick="selectTr('@rowcount','15','@item["l_id"]')">


                                        <td>@(rowcount + ((int)ViewBag.PageIndex - 1) * (int)ViewBag.PageSize)</td>
                                        <td>@(item["l_cu_name"])</td>
                                        <td>@(item["l_addtime"])<br />@(item["l_content"])</td>
                                        <td>@(item["l_ip"])</td>

                                    </tr>
                                }
                                @if (rowcount < 1)
                                {
                                    <tr class="no-data"><td colspan="5" style="text-align:center">暂时没有数据</td></tr>
                                }
                            </tbody>
                        </table>
                        @Html.Raw(new FileServer.Common.PageHelper().GetPageHtml((int)ViewBag.RecordCount, (int)ViewBag.PageIndex, (int)ViewBag.PageCount))
                    </div>
                </div><!--表格结束-->
            </div>
        </div>
        <div id="saper-ft"></div>
    </form>
</div>
